<!DOCTYPE html>
<html lang="en">

	<head>
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
		<meta charset="UTF-8">
		<title>登录</title>
		<link rel="stylesheet" href="css/weui.css">
		<!--<link rel="stylesheet" href="css/jquery-weui.min.css">-->
		<link rel="stylesheet" href="css/map.css">
	</head>

	<body>
		<div class="add"></div>
		<div class="weui-cells weui-cells_form">
			<div class="weui-cell">
				<!--<div class="weui-cell__hd"><label class="weui-label">手机号/用户名</label></div>-->
				<div class="weui-cell__bd">
					<input class="weui-input login_phone" type="text" id="login_text"  placeholder="请输入邮箱/用户名">
				</div>
				<div class="weui-cell__ft">
					<i class="weui-icon-warn"></i>
				</div>
			</div>
			<div class="weui-cell">
				<!--<div class="weui-cell__hd"><label class="weui-label">密码</label></div>-->
				<div class="weui-cell__bd">
					<input class="weui-input login_pwd" id="login_pwd" type="password" placeholder="请输入密码">
				</div>
				<div class="weui-cell__ft">
					<i class="weui-icon-safe-success"></i>
				</div>
			</div>
			<a class="weui-btn weui-btn_plain-primary login_click">登录</a>
			<a href="register.html" class="weui-btn weui-btn_plain-primary">注册</a>
			<a href="index.html" class="weui-btn weui-btn_plain-primary">返回首页</a>
		</div>
		<script src="js/av-min-2.1.2.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery-2.1.4.js"></script>
		<script src="js/fastclick.js"></script>
		<!--<script src="js/login.js"></script>-->
		<script>
			$(function() {
				FastClick.attach(document.body);
			});
			
			//接入leanCloud注册邮箱
			var isreg = false;
			window.onload = function() {
				var APP_ID = 'hN1kSQf2DQ9awcJmwEmIIdVo-gzGzoHsz';
				var APP_KEY = 'aHCVjhhcyeerTEsKObkGSyd6';
				AV.init({
					appId: APP_ID,
					appKey: APP_KEY
				});
			}
			
			$(".login_click").click(function  () {
				
			AV.User.logIn($("#login_text").val(), $("#login_pwd").val()).then(function(loginedUser) {
				alert('登录成功')
				location.href = "info.html";
			}, function(error) {
									alert(JSON.stringify(error));
			});
		
			})
			
		</script>
	</body>

</html>